<!-- 患者变更申请 -->
<template>
	<view class="alter F8">
		<view class="alter F8" >
			<view class="alter1 F">
			<text>患者</text>
			<view class="alter1-view">
				<image  class="photo1" :src="list.patientHeadPortrait"></image>
				<text>{{list.patientName}}</text>
			</view>
			
		</view>
		<view class="alter3 F">
			<text>负责医生</text>
			<view class="alter1-view">
				<image  class="photo1" :src="list.doctorHeadPortrait"></image>
				<text>{{list.doctorName}}</text>
			</view>
		</view>
		<view class="alter3 F">
			<text>申请时间</text>
			<view class="alter2">
				<lyzml-datepicker ref="lyzmlDatePicker" :config="datePickerConfig"  @onDateChange="chooseDate"  ></lyzml-datepicker>
			</view>
		</view>
		<button class="Check4" @click="Check4">处理完毕</button>
		</view>
		
	</view>
</template>

<script>
	// 时间控件
	import lyzmlDatePicker from '../../components/lyzml-datepicker/lyzml-datepicker.vue'
	export default {
		
		computed: {
			datePickerConfig: function() {
				let retObj = {
					yearsBefore: 15,
					yearsAfter: 0,
					initType: "ymd",
					initDate:""
				};
				return retObj;
			}
		},
		
		data() {
			return {
				list:[],
				patId:17
			}
		},
		onLoad(options) {
			var that=this;
			that.patId=JSON.parse(options.ind);
			uni.request({
				url:this.$serverUrl + '/app/hospital/patient/patientChangeInfo',
				data: {
					patientChangeId:that.patId
				},
				method:"POST",
				header:{
					'token': uni.getStorageSync('token'),
					'content-type': "application/json",
					'content-type': "application/x-www-form-urlencoded"
				},
				success: (ret) => {
					console.log(ret);
					if(ret.data.data!=null){
						that.list=ret.data.data;
					}
					
					console.log(ret.data.data);
				}
			})
			
		},
		methods: {
			Check4() {
				var that=this;
				uni.request({
					url:this.$serverUrl + '/app/hospital/patient/updatePatientChangeStatus',
					data: {
						patientChangeId:that.patId
					},
					method:"POST",
					header:{
						'token': uni.getStorageSync('token'),
						'content-type': "application/json",
						'content-type': "application/x-www-form-urlencoded"
					},
					success: (ret) => {
						if (ret.statusCode !== 200) {
							console.log('请求失败', ret)
							return;
						};
					uni.switchTab({
						url:'/pages/patientmanage/patientmanage'
					})
					}
				})
			
			},
			chooseDate(e) {
				this.useDate= e.value;
				console.log(this.useDate);
			},
			// setInitDate(){
			// 	 this.$refs.lyzmlDatePicker.initDate("2020-03-13");
			// }
			
		}
	}
</script>

<style>
	
	
.alter{
	display: flex;
	flex-direction: column;
	font-size: 30upx;
}
.photo1{
		width: 140upx;
		height:140upx;
		border-radius: 50%;
		margin-right: 40upx;
		align-items: center;
		margin-top:5upx;
	}

.alter1{
	display: flex;
	flex-direction: column;
	height: 200upx;
	padding: 0upx 30upx;
	margin-top: 15upx;
	margin-bottom: 15upx;
}
.alter1-view{
		display: flex;
		flex-direction: row;
		align-items: center;
}
.alter2{
	padding-top: 40upx;
	}
.alter3{
	display: flex;
	flex-direction: column;
	height: 200upx;
	padding: 0upx 30upx;
	/* margin-top: 15upx; */
	margin-bottom: 15upx;
}
/* .Check4{
	display: flex;
	background-color: #0079C3;
	width: 100%;
	justify-content: center;
	color: #fcfdfe;
	bottom: 0upx;
} */
.Check4{
	width: 100%;
	background-color: #0079c3;
	position: fixed;
	bottom: 0upx;
	color: #fcfdfe;
	}
</style>
